package com.elong.businesstravel.protocol.hotel;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.apache.http.HttpEntity;
import org.apache.http.entity.StringEntity;
import org.json.JSONObject;

import android.R.integer;
import android.content.Context;

import com.android.support.jhf.network.loopj.android.http.RequestParams;
import com.elong.businesstravel.base.mcrypt.MCrypt;
import com.elong.businesstravel.include.Version;
import com.elong.businesstravel.protocol.ProtocolDef;
import com.elong.businesstravel.protocol.baserequest.BaseELongHttpRequest;
/**
 * 获取酒店列表
 * @author lenovo
 *
 */
public class GetHotelListRequest extends BaseELongHttpRequest {
	
	public GetHotelListRequest(
			  Context context
			, String cityId
			, String startDate
			, String endDate
			, String minPrice
			, String maxpPrice
			, String star
			, String chainId
			, String bussinesId
			, String districtsId
			, Double lat
			, Double lng
			, String keyword
			, Integer pageSize
			, Integer page
			, Integer sorts
			, Integer product
			, Integer isfull
			, Integer uid
			, String deviceId
			, String token) {
		super(context);
		
		try {
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("cityid", cityId);
			jsonObject.put("startdate", startDate);
			jsonObject.put("enddate", endDate);
			if(null != minPrice)
				jsonObject.put("minprice", minPrice);
			if(null != maxpPrice)
				jsonObject.put("maxprice", maxpPrice);
			if(null != star)
				jsonObject.put("star", star);
			if(null != chainId)
				jsonObject.put("chainid", chainId);
			if(null != bussinesId)
				jsonObject.put("bussinesid", bussinesId);
			if(null != districtsId)
				jsonObject.put("districtsid", districtsId);
			if(null != lat)
				jsonObject.put("lat", lat);
			if(null != lng)
				jsonObject.put("lng", lng);
			if(null != keyword)
				jsonObject.put("keyword", keyword);
			jsonObject.put("pagesize", pageSize);
			jsonObject.put("page", page);
			jsonObject.put("sorts", sorts);
			jsonObject.put("product", product);
			jsonObject.put("isfull", isfull);
			if(null != uid)
				jsonObject.put("uid", uid);
			if(null != deviceId)
				jsonObject.put("deviceId", deviceId);
			if(null != token)
				jsonObject.put("token", token);
			
			setRequestActionParam(ProtocolDef.ACTION_GetHotelList, jsonObject);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
